package com.huishi.util;

public class TimeUtils {

    public static long conventTimeToMillion(Long interval, String unit) {
        switch (unit.toUpperCase()) {
            case "秒":
                return interval * 1000;
            case "分钟":
                return interval * 60 * 1000;
            case "小时":
                return interval * 60 * 60 * 1000;
            case "天":
                return interval * 24 * 60 * 60 * 1000;
            case "周":
                return interval * 7 * 24 * 60 * 60 * 1000;
            case "月":
                return interval * 30 * 24 * 60 * 60 * 1000; // 近似一个月
            default:
                throw new IllegalArgumentException("Unsupported time unit: " + unit);
        }
    }
}
